cat>tmp<<EOF
[common]
server_addr = 47.115.218.13
server_port = 7000
tls_enable = true
EOF
if (( $#==1 ))
then
port=`echo $1|awk '{printf("%03d\n",$0)}'`
cat>>tmp<<EOF

[SSH_6$port]
type=tcp
local_ip=127.0.0.1
local_port=22
remote_port=6$port
EOF
fi

mkdir /etc/frp/
mkdir tmpDir
mv ./tmp /etc/frp/frpc.ini
cd tmpDir
#wget https://github.com/fatedier/frp/releases/download/v0.44.0/frp_0.44.0_linux_amd64.tar.gz
#wget http://192.168.7.102:80/download/init_res/frp_0.44.0_linux_amd64.tar.gz
#wget http://yidaproserver.ltd:7001/download/init_res/frp_0.44.0_linux_amd64.tar.gz
wget https://gitee.com/xiaoxiaofeihh/tuku/raw/main/frp_0.44.0_linux_amd64.tar.gz
tar -xf ./frp_0.44.0_linux_amd64.tar.gz
cd frp_0.44.0_linux_amd64
mv ./frpc /usr/bin/
cat>tmp<<EOF
[Unit]
Description=Frp Client Service
After=network.target
[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/bin/frpc -c /etc/frp/frpc.ini
ExecReload=/usr/bin/frpc reload -c /etc/frp/frpc.ini
LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
EOF
mv ./tmp /etc/systemd/system/frpc.service
systemctl start frpc
systemctl enable frpc
